#include "inputdialog.h"

InputDialog::InputDialog(QString title, QString btnLabel, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f)
{
        setModal(true);
        setWindowTitle(title);
        edPort = new QLineEdit();
        btnOk = new QPushButton(btnLabel);
        QHBoxLayout *lay = new QHBoxLayout();
        lay->addWidget(edPort);
        lay->addWidget(btnOk);
        setLayout(lay);
        btnOk->setDefault(true);
        connect(btnOk, SIGNAL(clicked()), this, SLOT(onOkClicked()));
        setFixedWidth(300);
        show();
}

void InputDialog::onOkClicked()
{
        emit valueSet(edPort->text());//wysyla port na jakim bedzie dzialal server
        done(0);
}

InputDialog::~InputDialog() {
}

